package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ChatSensitiveWordMapper;
import com.ruoyi.system.domain.ChatSensitiveWord;
import com.ruoyi.system.service.IChatSensitiveWordService;

/**
 * 敏感词Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-30
 */
@Service
public class ChatSensitiveWordServiceImpl implements IChatSensitiveWordService 
{
    @Autowired
    private ChatSensitiveWordMapper chatSensitiveWordMapper;

    /**
     * 查询敏感词
     * 
     * @param wordId 敏感词主键
     * @return 敏感词
     */
    @Override
    public ChatSensitiveWord selectChatSensitiveWordByWordId(Long wordId)
    {
        return chatSensitiveWordMapper.selectChatSensitiveWordByWordId(wordId);
    }

    /**
     * 查询敏感词列表
     * 
     * @param chatSensitiveWord 敏感词
     * @return 敏感词
     */
    @Override
    public List<ChatSensitiveWord> selectChatSensitiveWordList(ChatSensitiveWord chatSensitiveWord)
    {
        return chatSensitiveWordMapper.selectChatSensitiveWordList(chatSensitiveWord);
    }

    /**
     * 新增敏感词
     * 
     * @param chatSensitiveWord 敏感词
     * @return 结果
     */
    @Override
    public int insertChatSensitiveWord(ChatSensitiveWord chatSensitiveWord)
    {
        chatSensitiveWord.setCreateTime(DateUtils.getNowDate());
        return chatSensitiveWordMapper.insertChatSensitiveWord(chatSensitiveWord);
    }

    /**
     * 修改敏感词
     * 
     * @param chatSensitiveWord 敏感词
     * @return 结果
     */
    @Override
    public int updateChatSensitiveWord(ChatSensitiveWord chatSensitiveWord)
    {
        chatSensitiveWord.setUpdateTime(DateUtils.getNowDate());
        return chatSensitiveWordMapper.updateChatSensitiveWord(chatSensitiveWord);
    }

    /**
     * 批量删除敏感词
     * 
     * @param wordIds 需要删除的敏感词主键
     * @return 结果
     */
    @Override
    public int deleteChatSensitiveWordByWordIds(Long[] wordIds)
    {
        return chatSensitiveWordMapper.deleteChatSensitiveWordByWordIds(wordIds);
    }

    /**
     * 删除敏感词信息
     * 
     * @param wordId 敏感词主键
     * @return 结果
     */
    @Override
    public int deleteChatSensitiveWordByWordId(Long wordId)
    {
        return chatSensitiveWordMapper.deleteChatSensitiveWordByWordId(wordId);
    }
}
